home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / prog / mod2tutb.zip / PC.MOD < prev    next >
Text File  |  1989-01-18  |  2KB  |  52 lines

  1. MODULE PC;
  2.  
  3. (* The codes in this program are for an EPSON RX-80.  You may have *)
  4. (* to adjust the codes for your printer.                           *)
  5.  
  6. FROM InOut IMPORT WriteString, WriteLn, Read, Write;
  7. FROM FileSystem IMPORT Lookup, WriteChar, Close, File;
  8.  
  9. VAR InputChar, Char0, Char1 : CHAR;
  10.     PrintFile               : File;
  11.  
  12. BEGIN
  13.    WriteString("F Formfeed");                    WriteLn;
  14.    WriteString("C/N Compressed/Normal");         WriteLn;
  15.    WriteString("D/S DoubleStrike/SingleStrike"); WriteLn;
  16.    WriteString("E/R Emphasized/Regular");        WriteLn;
  17.    WriteLn;
  18.    WriteString("Enter Selection --> ");
  19.    Read(InputChar);
  20.    Write(InputChar);
  21.    InputChar := CAP(InputChar);
  22.  
  23.                           (* Character input - now output the code *)
  24.  
  25.    CASE InputChar OF
  26.     'F' : Char0 := 14C;      (* Formfeed *)
  27.           Char1 := 0C;   |
  28.     'C' : Char0 := 17C;      (* Compressed mode *)
  29.           Char1 := 0C;   |
  30.     'N' : Char0 := 22C;      (* Normal width *)
  31.           Char1 := 0C;   |
  32.     'D' : Char0 := 33C;      (* Double Strike - esc-'G' *)
  33.           Char1 := 107C; |
  34.     'S' : Char0 := 33C;      (* Single Strike - esc-'H' *)
  35.           Char1 := 110C; |
  36.     'E' : Char0 := 33C;      (* Emphasized Print - esc-'E' *)
  37.           Char1 := 105C; |
  38.     'R' : Char0 := 33C;      (* Emphasized Off - esc-'@' *)
  39.           Char1 := 100C;
  40.    ELSE
  41.       WriteString("Invalid Character.");
  42.    END;
  43.  
  44.    Lookup(PrintFile,"PRN",TRUE);    (* Open print file *)
  45.    WriteChar(PrintFile,Char0);
  46.    IF Char1 > 0C THEN
  47.       WriteChar(PrintFile,Char1);
  48.    END;
  49.    Close(PrintFile);
  50.  
  51. END PC.
  52.